package com.yf1706.bean;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.Date;
import java.util.List;


/**
 * The persistent class for the base_salary_sob database table.
 * 
 */
@Entity
@Table(name="base_salary_sob")
@NamedQuery(name="BaseSalarySob.findAll", query="SELECT b FROM BaseSalarySob b")
public class BaseSalarySob implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="base_salary_sob_id")
	private int baseSalarySobId;

	@Column(name="base_salary_sob_name")
	private String baseSalarySobName;

	@Temporal(TemporalType.DATE)
	@JSONField(format="yyyy-MM-dd")
	@Column(name="build_date")
	private Date buildDate;

	private String builder;

	@Column(name="emp_num")
	private int empNum;

	private String remark;

	//bi-directional many-to-one association to BaseSalary
	@OneToMany(mappedBy="baseSalarySob")
	@JSONField(serialize = false)
	private List<BaseSalary> baseSalaries;

	public BaseSalarySob() {
	}

	public BaseSalarySob(int baseSalarySobId, String baseSalarySobName, Date buildDate, String builder, int empNum,
			String remark) {
		super();
		this.baseSalarySobId = baseSalarySobId;
		this.baseSalarySobName = baseSalarySobName;
		this.buildDate = buildDate;
		this.builder = builder;
		this.empNum = empNum;
		this.remark = remark;
	}

	@Override
	public String toString() {
		return "BaseSalarySob [baseSalarySobId=" + baseSalarySobId + ", baseSalarySobName=" + baseSalarySobName
				+ ", buildDate=" + buildDate + ", builder=" + builder + ", empNum=" + empNum + ", remark=" + remark
				+ ", baseSalaries=" + baseSalaries + "]";
	}

	public int getBaseSalarySobId() {
		return this.baseSalarySobId;
	}

	public void setBaseSalarySobId(int baseSalarySobId) {
		this.baseSalarySobId = baseSalarySobId;
	}

	public String getBaseSalarySobName() {
		return this.baseSalarySobName;
	}

	public void setBaseSalarySobName(String baseSalarySobName) {
		this.baseSalarySobName = baseSalarySobName;
	}

	public Date getBuildDate() {
		return this.buildDate;
	}

	public void setBuildDate(Date buildDate) {
		this.buildDate = buildDate;
	}

	public String getBuilder() {
		return this.builder;
	}

	public void setBuilder(String builder) {
		this.builder = builder;
	}

	public int getEmpNum() {
		return this.empNum;
	}

	public void setEmpNum(int empNum) {
		this.empNum = empNum;
	}

	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public List<BaseSalary> getBaseSalaries() {
		return this.baseSalaries;
	}

	public void setBaseSalaries(List<BaseSalary> baseSalaries) {
		this.baseSalaries = baseSalaries;
	}

	public BaseSalary addBaseSalary(BaseSalary baseSalary) {
		getBaseSalaries().add(baseSalary);
		baseSalary.setBaseSalarySob(this);

		return baseSalary;
	}

	public BaseSalary removeBaseSalary(BaseSalary baseSalary) {
		getBaseSalaries().remove(baseSalary);
		baseSalary.setBaseSalarySob(null);

		return baseSalary;
	}

}